TMCUndoStack< T > Class Template Reference
[MCCore]

List of all members.

Public Member Functions

 TMCUndoStack ()
 TMCUndoStack (int32 maxSize)
T * Do ()
T * DoMore ()
T * Undo ()
T * Redo ()
void SetMaxSize (int32 maxSize)
uint32 GetElemCount () const

Protected Attributes

int32 fMaxSize
int32 fCurrent
int32 fLast
TMCPtrArray< T > fArrayData

Detailed Description

template<class T>
class TMCUndoStack< T >

TMCUndoStack store data in a stack and can return a pointer to previous states using undo/redo. It can be use for a simple auxiliary mecanism of undo/redo


Constructor & Destructor Documentation

template<class T>
TMCUndoStack< T >::TMCUndoStack (   ) 
 

Prepare a new TMCUndoStack. maxSize is fixed to 16 elem

template<class T>
TMCUndoStack< T >::TMCUndoStack (  int32  maxSize  ) 
 

Prepare a new TMCUndoStack

Parameters:
maxSize maximum number of element in the undo stack


Member Function Documentation

template<class T>
T * TMCUndoStack< T >::Do (   )  [inline]
 

Creates and adds a new param T to the stack and returns a pointer to it

template<class T>
T * TMCUndoStack< T >::DoMore (   )  [inline]
 

Return a pointer to the current state to allow modification on it

template<class T>
uint32 TMCUndoStack< T >::GetElemCount (   )  const [inline]
 

Gets the number of elements allocated.

template<class T>
T * TMCUndoStack< T >::Redo (   )  [inline]
 

Access to the data of the next state.

Returns:
a pointer to the next state. NULL if none exist.

template<class T>
void TMCUndoStack< T >::SetMaxSize (  int32  maxSize  )  [inline]
 

Sets the maximum number of element in the undo stack

template<class T>
T * TMCUndoStack< T >::Undo (   )  [inline]
 

Access to the data of the previous state.

Returns:
a pointer to the previous state. NULL if none exist.


Member Data Documentation

template<class T>
TMCPtrArray<T> TMCUndoStack< T >::fArrayData [protected]
 

template<class T>
int32 TMCUndoStack< T >::fCurrent [protected]
 

template<class T>
int32 TMCUndoStack< T >::fLast [protected]
 

template<class T>
int32 TMCUndoStack< T >::fMaxSize [protected]
 


The documentation for this class was generated from the following file:
Generated on Wed Dec 7 14:27:49 2005 for Carrara SDK Doc by  doxygen 1.4.5